package com.t282.crm.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.t282.crm.entity.BasDict;
import com.t282.crm.entity.CstCustomer;
import com.t282.crm.service.BasDictService;
import com.t282.crm.service.impl.BasDictServiceImpl;
import com.t282.crm.service.impl.CstCustomerServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/common")
public class CommonController {
    @Autowired
    private BasDictServiceImpl basDictService;

    @ApiOperation("查询公共条件")
    @ResponseBody
    @RequestMapping("findAll")
    public Object findAll(String dictType){
        QueryWrapper<BasDict> wrapper = new QueryWrapper<>();
        wrapper.eq("dict_type",dictType);
        List<BasDict> list = basDictService.list(wrapper);
        return list;
    }
}
